<%@ page language="java" contentType="text/html; charset=UTF-8"	 pageEncoding="UTF-8"%>
<%@ include file="../include/laypublic.jsp"%>
<!DOCTYPE html>
<html>
<head>
  <title>业务承接统计</title>
  <style type="text/css">
  </style>
</head>
<body>
  <div class="layui-fluid">   
    <div class="layui-card">
      <!-- 查询区域  -->
      <div id="query-form" class="layui-form layui-card-header layuiadmin-card-header-auto">
        <div class="layui-form-item">
          <div class="layui-inline">
            	<label class="layui-form-label" style="width:130px;">中标通知书日期</label>
            	<div class="layui-input-inline">
              		<input type="text" class="layui-input" id="notice_date_start"  name="noticeDateStart" readonly placeholder="开始日期">
            	</div>
            	<div class="layui-form-mid">
               	-
            	</div>
            	<div class="layui-input-inline">
              		<input type="text" class="layui-input" id="notice_date_end" name="noticeDateEnd" readonly placeholder="结束日期">
            	</div>
          </div>
          <div class="layui-inline">
            	<label class="layui-form-label">市场区域</label>
            	<div class="layui-input-inline">
              		<input type="text" name="sgCityName" id="query_input_sgCityName" placeholder="请输入" autocomplete="off" class="layui-input" >
            	</div>
          </div>
          <div class="layui-inline">
            	<label class="layui-form-label" style="width:130px;">项目名称</label>
            	<div class="layui-input-inline">
              		<input type="text" name="orgProName" id="query_input_orgProName"  placeholder="请输入" autocomplete="off" class="layui-input" >
            	</div>
          </div>
          	<shiro:hasPermission name="LIST_ACCEPT_COLLECT">
	          <div class="layui-inline">
	            <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-acceptCollect-search">
	              <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
	            </button>
	          </div>
          	</shiro:hasPermission>
        </div>
      </div>
      <div class="layui-card-body">
      	<div style="text-align: center; margin-top:5px;  margin-bottom:18px;">
	          <div class="layui-inline" style="float:right;margin-bottom:2px;margin-right:0px;">
		         <label class="layui-form-label">单位：万元</label> 
          	  </div>
        </div>
        <hr/>
        <table id="LAY-acceptCollect-manage" lay-filter="LAY-acceptCollect-manage"></table>
      </div>
    </div>
  </div>

  <script>
  var stageJSON = <infopub:dicJson groupNo="A00010077" />;
  	layui.config({
    	base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
  	}).extend({
    	index: 'lib/index' //主入口模块
  	}).use(['index', 'table', 'set', 'laydate', 'element'], function(){
    	var $ = layui.$
    	,form = layui.form
    	,table = layui.table
    	,laydate = layui.laydate
    	,element = layui.element;
    	
    	var insStart = laydate.render({   		
    		elem: '#notice_date_start'
    		,btns: ['now', 'confirm']
  	        ,format:'yyyy年MM月dd日'
		    ,value: layui.util.toDateString(new Date().getTime() - 2592000000 , 'yyyy年MM月dd日') //30天前
 	  	    ,done: function(value, date){
 	  	    //更新结束日期的最小日期
 	  	    insEnd.config.min = lay.extend({}, date, {
 	  	    	month: date.month - 1
 	  	    });
 	  	        
 	  	    //自动弹出结束日期的选择器
 	  	   insEnd.config.elem[0].focus();
 	  	    
 	  		table.reload('LAY-acceptCollect-manage', {page: {curr: 1},
		 	 where: {'noticeDateStart':value,'noticeDateEnd':$("#notice_date_end").val(),'sgCityName':$('#query_input_sgCityName').val(),'orgProName':$('#query_input_orgProName').val()}
	      	});
 	  	 }
      });	
	     	    
    	var insEnd = laydate.render({
	      elem: '#notice_date_end'
	      ,btns: ['now', 'confirm']
    	  ,format:'yyyy年MM月dd日'
     	  ,value: layui.util.toDateString(new Date().getTime(), 'yyyy年MM月dd日')//显示当前日期
	      ,done:function(value, date){
	    	  //更新开始日期的最大日期
        	  insStart.config.max = lay.extend({}, date, {
	  	          month: date.month - 1
	  	      });
	    	  
	      	  table.reload('LAY-acceptCollect-manage', {page: {curr: 1},
			 	 where: {'noticeDateStart':$("#notice_date_start").val(),'noticeDateEnd':value,'sgCityName':$('#query_input_sgCityName').val(),'orgProName':$('#query_input_orgProName').val()}
		      });
	      }
	    });
	    
		var noticeDateStart = $('#notice_date_start').val();
		var noticeDateEnd = $('#notice_date_end').val();
    	// 表单
    	table.render({
      		elem: '#LAY-acceptCollect-manage'
      		,url: basePath + '/acceptCollect/queryDataByCondition' //请求数据接口
      		,where: {'noticeDateStart':noticeDateStart,'noticeDateEnd':noticeDateEnd,'sgCityName':$('#query_input_sgCityName').val(),'orgProName':$('#query_input_orgProName').val()}
      		,cols: [[
				{type:'numbers', title: '序号',fixed:'left', width: 80, align:'center', rowspan: 2}
				,{field: 'sgCityName', title: '市场区域',fixed:'left',width: 170, align:'center', rowspan: 2}
				,{field: 'proName', title: '项目名称',fixed:'left',width: 280, align:'center', rowspan: 2}
				,{field: 'noticeDate', title: '中标通知书日期', width: 170,align:'center', rowspan: 2, templet: function(d){
        		  	return layui.util.toDateString(d.noticeDate,"yyyy-MM-dd");
              		}
             	}
				,{field: 'workYears', title: '合作期限（年）',width: 150, align:'center', rowspan: 2}
				,{field: 'sumAmount', title: '总投资额',width: 180, align:'center',rowspan: 2,templet: function(d){
					    return formatCurrency(d.sumAmount);
					}
				}
				,{title: '投资构成', align:'center', colspan: 6}
				,{field: 'takeType', title: '承接方式', width: 100,align:'center', rowspan: 2, templet: function(d){
        		  		if(d.takeType=='1'){
        		  			return "建投自接";
        		  		}else if(d.takeType=='2'){
        		  			return "产业联合";
        		  		}
              		}
             	}
				,{field: 'normPercent', title: '指标占比（%）',width: 150, align:'center', rowspan: 2}
				,{field: 'subTotalCae', title: '建安指标小计',width: 180, align:'center',rowspan: 2,templet: function(d){
				    	return formatCurrency(d.subtotalCae);
					}
				}
				,{field: 'otherRemark', title: '备注说明',width: 180, align:'center',rowspan: 2}					    
				],[
					{field: 'costCae', title: '建安工程费',width: 180, align:'center', templet: function(d){
					    return formatCurrency(d.costCae);
					}}
					,{field: 'deviceCost', title: '设备购置费工程费',width: 180, align:'center', templet: function(d){
					    return formatCurrency(d.deviceCost);
					}}
					,{field: 'inReadyCost', title: '预备费',width: 180, align:'center', templet: function(d){
					    return formatCurrency(d.inReadyCost);
					}}
					,{field: 'periodInterest', title: '建设期利息',width: 180, align:'center', templet: function(d){
					    return formatCurrency(d.periodInterest);
					}} 
					,{field: 'fluidCapital', title: '铺底流动资金',width: 180, align:'center', templet: function(d){
					    return formatCurrency(d.fluidCapital);
					}}
					,{field: 'otherCost', title: '工程建设其他费',width: 180, align:'center', templet: function(d){
					    return formatCurrency(d.otherCost);
					}}
				]]
      		,page: true
      		,limit: 10
    	});
    
    	<shiro:hasPermission name="LIST_ACCEPT_COLLECT">
	    	//监听搜索
	    	form.on('submit(LAY-acceptCollect-search)', function(data){
		      	//执行重载
		      	table.reload('LAY-acceptCollect-manage', {page: {curr: 1},
		        	where: trimData(data)
		      	});
	    	});
    	</shiro:hasPermission>
  });
  	
  </script>
</body>
</html>

